package com.project.internship.utils;

import com.project.internship.entity.User;
import org.springframework.security.core.context.SecurityContextHolder;

public class UserUtils {

    //获取当前User对象
    public static User getCurrentUser(){
        return (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }

}
